
import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:package_info/package_info.dart';

import 'state.dart';

class SetUpLogic extends GetxController {
  final state = SetUpState();

  @override
  void onInit() async{
    super.onInit();
    if (!kIsWeb) {
      PackageInfo packageInfo = await PackageInfo.fromPlatform();
      state.version = packageInfo.version ?? "";
      state.buildNumber = packageInfo.buildNumber ?? "";
    } else {
      state.version = "";
      state.buildNumber = "";
    }
    update();
  }
}